<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName()
            + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>客户管理-BootCRM</title>
    <!-- 引入css样式文件 -->
    <!-- Bootstrap Core CSS -->
    <link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet"/>
    <!-- MetisMenu CSS -->
    <link href="<%=basePath%>css/metisMenu.min.css" rel="stylesheet"/>
    <!-- DataTables CSS -->
    <link href="<%=basePath%>css/dataTables.bootstrap.css" rel="stylesheet"/>
    <!-- Custom CSS -->
    <link href="<%=basePath%>css/sb-admin-2.css" rel="stylesheet"/>
    <!-- Custom Fonts -->
    <link href="<%=basePath%>css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="<%=basePath%>css/boot-crm.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="wrapper">
    <!-- 导航栏部分 -->
    <nav class="navbar navbar-default navbar-static-top" role="navigation"
         style="margin-bottom: 0">
        <div class="navbar-header">
            <a class="navbar-brand" href="<%=basePath%>customer/list.action">BOOT客户管理系统 v2.0</a>
        </div>
        <!-- 导航栏右侧图标部分 -->
        <ul class="nav navbar-top-links navbar-right">
            <!-- 邮件通知 start -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-envelope fa-fw"></i>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-messages">
                    <li>
                        <a href="#">
                            <div>
                                <strong>张经理</strong> <span class="pull-right text-muted">
								<em>昨天</em>
							</span>
                            </div>
                            <div>今天晚上开会，讨论一下下个月工作的事...</div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>查看全部消息</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
            </li>
            <!-- 邮件通知 end -->
            <!-- 任务通知 start -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-tasks fa-fw"></i>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-tasks">
                    <li>
                        <a href="#">
                            <div>
                                <p>
                                    <strong>任务 1</strong>
                                    <span class="pull-right text-muted">完成40%</span>
                                </p>
                                <div class="progress progress-striped active">
                                    <div class="progress-bar progress-bar-success"
                                         role="progressbar" aria-valuenow="40" aria-valuemin="0"
                                         aria-valuemax="100" style="width: 40%">
                                        <span class="sr-only">完成40%</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <p>
                                    <strong>任务 2</strong>
                                    <span class="pull-right text-muted">完成20%</span>
                                </p>
                                <div class="progress progress-striped active">
                                    <div class="progress-bar progress-bar-info" role="progressbar"
                                         aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"
                                         style="width: 20%">
                                        <span class="sr-only">完成20%</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>查看所有任务</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
            </li>
            <!-- 任务通知 end -->
            <!-- 消息通知 start -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-bell fa-fw"></i>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-alerts">
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-comment fa-fw"></i> 新回复
                                <span class="pull-right text-muted small">4分钟之前</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-envelope fa-fw"></i> 新消息
                                <span class="pull-right text-muted small">4分钟之前</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-tasks fa-fw"></i> 新任务
                                <span class="pull-right text-muted small">4分钟之前</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="#">
                            <div>
                                <i class="fa fa-upload fa-fw"></i> 服务器重启
                                <span class="pull-right text-muted small">4分钟之前</span>
                            </div>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a class="text-center" href="#">
                            <strong>查看所有提醒</strong>
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                </ul>
            </li>
            <!-- 消息通知 end -->
            <!-- 用户信息和系统设置 start -->
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    <i class="fa fa-user fa-fw"></i>
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li><a href="#"><i class="fa fa-user fa-fw"></i>
                        用户：${sessionScope.user.userName}
                    </a>
                    </li>
                    <li><a href="#"><i class="fa fa-gear fa-fw"></i> 系统设置</a></li>
                    <li class="divider"></li>
                    <li>
                        <a href="${pageContext.request.contextPath }/logout">
                            <i class="fa fa-sign-out fa-fw"></i>退出登录
                        </a>
                    </li>
                </ul>
            </li>
            <!-- 用户信息和系统设置结束 -->
        </ul>
        <!-- 左侧显示列表部分 start-->
        <div class="navbar-default sidebar" role="navigation">
            <div class="sidebar-nav navbar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="sidebar-search">
                        <div class="input-group custom-search-form">
                            <input type="text" class="form-control" placeholder="查询内容...">
                            <span class="input-group-btn">
							<button class="btn btn-default" type="button">
								<i class="fa fa-search" style="padding: 3px 0 3px 0;"></i>
							</button>
						</span>
                        </div>
                    </li>
                    <li>
                        <a href="${pageContext.request.contextPath }/customer" class="active">
                            <i class="fa fa-edit fa-fw"></i> 客户管理
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <i class="fa fa-dashboard fa-fw"></i> 客户拜访
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- 左侧显示列表部分 end-->
    </nav>
    <!-- 客户列表查询部分  start-->
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">客户管理</h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="panel panel-default">
            <div class="panel-body">
                <form class="form-inline" method="post"
                      action="${pageContext.request.contextPath }/customer/queryLike">
                    <div class="form-group">
                        <label for="customerName">客户名称</label>
                        <input type="text" class="form-control" id="customerName"
                               value="${customer.custName}" name="custName"/>
                    </div>
                    <div class="form-group">
                        <label for="customerFrom">客户来源</label>
                        <select class="form-control" id="customerFrom" name="custSource">
                            <option value="" disabled selected>--请选择--</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="custIndustry">所属行业</label>
                        <select class="form-control" id="custIndustry" name="custIndustry">
                            <option value="" selected disabled>--请选择--</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="custLevel">客户级别</label>
                        <select class="form-control" id="custLevel" name="custLevel">
                            <option value="" selected disabled>--请选择--</option>
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">查询</button>
                </form>
            </div>
        </div>
        <a href="#" class="btn btn-primary" data-toggle="modal"
           data-target="#newCustomerDialog" onclick="clearCustomer()">新建</a>
        <div><br></div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">客户信息列表</div>
                    <!-- /.panel-heading -->
                    <table class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>客户名称</th>
                            <th>客户来源</th>
                            <th>客户所属行业</th>
                            <th>客户级别</th>
                            <th>固定电话</th>
                            <th>手机</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="customer" items="${customers}">
                            <tr>
                                <td>${customer.custId}</td>
                                <td>${customer.custName}</td>
                                <td>${customer.custSource}</td>
                                <td>${customer.custIndustry}</td>
                                <td>${customer.custLevel}</td>
                                <td>${customer.custPhone}</td>
                                <td>${customer.custMobile}</td>
                                <td>
                                    <a href="#" class="btn btn-primary btn-xs" data-toggle="modal"
                                       data-target="#customerEditDialog"
                                       onclick="editCustomer('${customer.custId}')">修改</a>
                                    <a href="#" class="btn btn-danger btn-xs"
                                       onclick="deleteCustomer('${customer.custId}')">删除</a>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <c:if test="${pageBean!=null}">
                        <div class="col-md-12 text-right">
                            <h6></h6>
                            <span>
                            共${pageBean.totalCount}条数据，
                            每页显示<input name="pageSize" value="${pageBean.pageSize}" style="width: 50px;"
                                       onchange="changePageSize()"> 条，
                            共${pageBean.totalPage}页，
                            当前第${pageBean.currentPage}页。
                        </span>
                            <a href="<%=basePath%>customer?currentPage=1&pageSize=${pageBean.pageSize}">首页</a>
                            <c:if test="${pageBean.hasPrevious}">
                                <a href="<%=basePath%>customer?currentPage=${pageBean.currentPage-1}&pageSize=${pageBean.pageSize}">上一页</a>
                            </c:if>
                            <c:if test="${not pageBean.hasPrevious}">
                                <a href="#" disabled="">上一页</a>
                            </c:if>
                            <c:if test="${pageBean.hasNext}">
                                <a href="<%=basePath%>customer?currentPage=${pageBean.currentPage+1}&pageSize=${pageBean.pageSize}">下一页</a>
                            </c:if>
                            <c:if test="${not pageBean.hasNext}">
                                <a href="#" disabled="">下一页</a>
                            </c:if>
                            <a href="<%=basePath%>customer?currentPage=${pageBean.totalPage}&pageSize=${pageBean.pageSize}">尾页</a>
                        </div>
                    </c:if>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
    </div>
    <!-- 客户列表查询部分  end-->
</div>
<!-- 创建客户模态框 -->
<div class="modal fade" id="newCustomerDialog" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">新建客户信息</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="new_customer_form">
                    <div class="form-group">
                        <label for="new_customerName" class="col-sm-2 control-label">
                            客户名称
                        </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="new_customerName" placeholder="客户名称"
                                   name="custName"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_customerFrom" style="float:left;padding:7px 15px 0 27px;">客户来源</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="new_customerFrom" name="custSource">
                                <option value="" disabled>--请选择--</option>

                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_custIndustry" style="float:left;padding:7px 15px 0 27px;">所属行业</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="new_custIndustry" name="custIndustry">
                                <option value="" disabled>--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_custLevel" style="float:left;padding:7px 15px 0 27px;">客户级别</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="new_custLevel" name="custLevel">
                                <option value="" disabled>--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_linkMan" class="col-sm-2 control-label">联系人</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="new_linkMan" placeholder="联系人"
                                   name="custLinkman"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_phone" class="col-sm-2 control-label">固定电话</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="new_phone" placeholder="固定电话" name="custPhone"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_mobile" class="col-sm-2 control-label">移动电话</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="new_mobile" placeholder="移动电话"
                                   name="custMobile"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_zipcode" class="col-sm-2 control-label">邮政编码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="new_zipcode" placeholder="邮政编码"
                                   name="custZipcode"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="new_address" class="col-sm-2 control-label">联系地址</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="new_address" placeholder="联系地址"
                                   name="custAddress"/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="createCustomer()">创建客户</button>
            </div>
        </div>
    </div>
</div>
<!-- 修改客户模态框 -->
<div class="modal fade" id="customerEditDialog" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">修改客户信息</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="edit_customer_form">
                    <input type="hidden" id="edit_cust_id" name="cust_id"/>
                    <div class="form-group">
                        <label for="edit_customerName" class="col-sm-2 control-label">客户名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_customerName" placeholder="客户名称"
                                   name="cust_name"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_customerFrom" style="float:left;padding:7px 15px 0 27px;">客户来源</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="edit_customerFrom" name="cust_source">
                                <option value="" disabled>--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_custIndustry" style="float:left;padding:7px 15px 0 27px;">所属行业</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="edit_custIndustry" name="cust_industry">
                                <option value="" disabled>--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_custLevel" style="float:left;padding:7px 15px 0 27px;">客户级别</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="edit_custLevel" name="cust_level">
                                <option value="" disabled>--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_linkMan" class="col-sm-2 control-label">联系人</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_linkMan" placeholder="联系人"
                                   name="cust_linkman"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_phone" class="col-sm-2 control-label">固定电话</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_phone" placeholder="固定电话"
                                   name="cust_phone"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_mobile" class="col-sm-2 control-label">移动电话</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_mobile" placeholder="移动电话"
                                   name="cust_mobile"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_zipcode" class="col-sm-2 control-label">邮政编码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_zipcode" placeholder="邮政编码"
                                   name="cust_zipcode"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="edit_address" class="col-sm-2 control-label">联系地址</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="edit_address" placeholder="联系地址"
                                   name="cust_address"/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="updateCustomer()">保存修改</button>
            </div>
        </div>
    </div>
</div>
<!-- 引入js文件 -->
<!-- jQuery -->
<script src="<%=basePath%>js/jquery-1.11.3.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="<%=basePath%>js/metisMenu.min.js"></script>
<!-- DataTables JavaScript -->
<script src="<%=basePath%>js/jquery.dataTables.min.js"></script>
<script src="<%=basePath%>js/dataTables.bootstrap.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="<%=basePath%>js/sb-admin-2.js"></script>
<!-- 编写js代码 -->
<script type="text/javascript">
    //清空新建客户窗口中的数据
    function clearCustomer() {
        $("#new_customerName").val("");
        $("#new_customerFrom").val("")
        $("#new_custIndustry").val("")
        $("#new_custLevel").val("")
        $("#new_linkMan").val("");
        $("#new_phone").val("");
        $("#new_mobile").val("");
        $("#new_zipcode").val("");
        $("#new_address").val("");
    }

    // 创建客户
    function createCustomer() {
        var new_customerName = $("#new_customerName").val();
        var new_customerFrom = $("#new_customerFrom").val()
        var new_custIndustry = $("#new_custIndustry").val()
        var new_custLevel = $("#new_custLevel").val()
        var new_linkMan = $("#new_linkMan").val();
        var new_phone = $("#new_phone").val();
        var new_mobile = $("#new_mobile").val();
        var new_zipcode = $("#new_zipcode").val();
        var new_address = $("#new_address").val();

        var arr = [
            new_customerName,
            new_customerFrom,
            new_custIndustry,
            new_custLevel,
            new_linkMan,
            new_phone,
            new_mobile,
            new_zipcode,
            new_address,
        ]
        var flag = false;

        for (var i = 0; i < arr.length; i++) {
            if (arr[i] === "") {
                flag = true;
                break;
            }
        }
        if (flag) {
            confirm("任何一项不能为空")
            return false;
        }
        $.ajax({
            url: "<%=basePath%>customer/add",
            method: "post",
            data: {
                custName: new_customerName,
                custSource: new_customerFrom,
                custIndustry: new_custIndustry,
                custLevel: new_custLevel,
                custLinkman: new_linkMan,
                custPhone: new_phone,
                custMobile: new_mobile,
                custZipcode: new_zipcode,
                custAddress: new_address,
            },
            success: function (resp) {
                if (resp.code === 200) {
                    location.reload();
                } else {
                    console.log(resp.data)
                }
            }
        })
    }

    // 通过id获取修改的客户信息
    function editCustomer(id) {
        window.id = id;
        $.ajax({
            url: "<%=basePath%>customer/" + id,
            method: "post",
            success: function (resp) {
                var customer = resp.data;
                $("#edit_customerName").val(customer.custName);
                $("#edit_customerFrom").val(customer.custSource);
                $("#edit_custIndustry").val(customer.custIndustry);
                $("#edit_custLevel").val(customer.custLevel);
                $("#edit_linkMan").val(customer.custLinkman);
                $("#edit_phone").val(customer.custPhone);
                $("#edit_mobile").val(customer.custMobile);
                $("#edit_zipcode").val(customer.custZipcode);
                $("#edit_address").val(customer.custAddress);
            }
        })
    }

    // 执行修改客户操作
    function updateCustomer() {
        var edit_customerName = $("#edit_customerName").val();
        var edit_customerFrom = $("#edit_customerFrom").val();
        var edit_custIndustry = $("#edit_custIndustry").val();
        var edit_custLevel = $("#edit_custLevel").val();
        var edit_linkMan = $("#edit_linkMan").val();
        var edit_phone = $("#edit_phone").val();
        var edit_mobile = $("#edit_mobile").val();
        var edit_zipcode = $("#edit_zipcode").val();
        var edit_address = $("#edit_address").val();

        $.ajax({
            url: "<%=basePath%>customer/update",
            method: "post",
            data: {
                custId: window.id,
                custName: edit_customerName,
                custSource: edit_customerFrom,
                custIndustry: edit_custIndustry,
                custLevel: edit_custLevel,
                custLinkman: edit_linkMan,
                custPhone: edit_phone,
                custMobile: edit_mobile,
                custZipcode: edit_zipcode,
                custAddress: edit_address,
            },
            success: function (resp) {
                if (resp.code === 200) {
                    location.reload();
                }
            }
        })
    }

    // 删除客户
    function deleteCustomer(id) {
        if (confirm('确实要删除该客户吗?')) {
            $.ajax({
                url: "<%=basePath%>customer/delete/" + id,
                method: "post",
                success: function (resp) {
                    if (resp.code === 200) {
                        alert("删除成功！")
                        location.reload();
                    }
                }
            })
        }
    }

    function changePageSize() {

        location.href = "<%=basePath%>customer?currentPage=1&pageSize=" + $("[name=pageSize]").val();

    }
    $.get("/api/dic/1", function (resp) {
        if (resp.code == 200) {
            var html="";
            resp.data.forEach(function (item) {
                html+="<option value='"+item.dictItemName+"'>"+item.dictItemName+"</option>";
            })
            $("#new_customerFrom").append(html)
            $("#edit_customerFrom").append(html)
            $("#customerFrom").append(html)
        }

    })

    $.get("/api/dic/2", function (resp) {
        if (resp.code == 200) {
            var html="";
            resp.data.forEach(function (item) {
                html+="<option value='"+item.dictItemName+"'>"+item.dictItemName+"</option>";
            })
            $("#new_custIndustry").append(html)
            $("#edit_custIndustry").append(html)
            $("#custIndustry").append(html)

        }
    })

    $.get("/api/dic/3", function (resp) {
        if (resp.code == 200) {
            var html="";
            resp.data.forEach(function (item) {
                html+="<option value='"+item.dictItemName+"'>"+item.dictItemName+"</option>";
            })
            $("#new_custLevel").append(html)
            $("#edit_custLevel").append(html)
            $("#custLevel").append(html)
        }
    })


</script>
</body>
</html>